const db = require('../db/index');
const DataTypes = require('sequelize');
/**es6继承 */
class Drives extends DataTypes.Model {}
Drives.init(
    {
        id: {
            type: DataTypes.INTEGER,
            allowNull: false,
            autoIncrement: true,
            primaryKey: true
        },
        merchantId: {
            type: DataTypes.INTEGER,
            comment: '商家ID',
            allowNull: false
        },
        deviceId: {
            type: DataTypes.STRING,
            comment: '设备编码ID',
            allowNull: false
        },
        areaName: {
            type: DataTypes.STRING,
            comment: '地区',
            allowNull: false
        },
        isOnline: {
            type: DataTypes.BOOLEAN,
            comment: '0 - 离线，1 - 在线',
            allowNull: false
        },
        useState: {
            type: DataTypes.INTEGER,
            comment:
                '0:空闲;1:投币洗车;2:刷卡洗车;3:微信洗车;4:停售;5:手机号洗车;6:会员扫码洗车; 7:缺泡沫',
            allowNull: false
        },
        src: {
            type: DataTypes.INTEGER,
            comment: '二维码',
            allowNull: false
        },
        lng: {
            type: DataTypes.STRING,
            comment: '经度'
        },
        lat: {
            type: DataTypes.STRING,
            comment: '纬度'
        }
    },
    {
        tableName: 'drives',
        modelName: 'drive',
        sequelize: db
    }
);
// Drives.sync({ force: true });
exports['default'] = Drives;
